<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="Content-type" content="text/html;charset=utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>vue 使用ajax请求数据动态绑定列表</title>

</head>
<body>

<ul id="list">
    <li v-for="item in list">{{item.id}}-{{item.name}}</li>
</ul>


<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/vue/2.2.2/vue.min.js"></script>
<script>
var vm = new Vue({
    el: "#list"
    , data: {
        list: []
    }
    , mounted: function () {
        this.show();
    }
    , methods: {
        show: function () {
            $.getJSON('json/list.json', function (data) {
                vm.list = data;
            })
        }
    }
});
</script>
</body>
</html>